import { createStore } from "vuex";
import createPersistedState from "vuex-persistedstate"

export default createStore({
  state: {
    playConfig:{
      isplay:false,
      playImg:"",
      playSinger:"",
      playSongName:"",
      totalTime:"",
      currentTime:"",
      playSrc:""
    }
  },
  getters:{ 
    playInfo:(state)=>state.playConfig
  },
  mutations: {
    changePlayInfo(state,songInfo){
      state.playConfig = songInfo
    },
    changeCurrentTime(state) {
      state.playConfig.currentTime = parseInt(state.playConfig.currentTime+'')+100+''
    }
  },
  actions: {},
  modules: {},
plugins: [createPersistedState()]

});
